package antlr;

import java.util.LinkedList;
import java.util.List;
import java.util.Stack;

import main.MetaGen;
import metagen.Capture;
import metagen.Charset;
import metagen.Concat;
import metagen.Dot;
import metagen.Eval;
import metagen.Literal;
import metagen.NRep;
import metagen.Opt;
import metagen.Plus;
import metagen.Ref;
import metagen.Star;
import metagen.Union;

import org.antlr.runtime.BaseRecognizer;
import org.antlr.runtime.BitSet;
import org.antlr.runtime.DFA;
import org.antlr.runtime.EarlyExitException;
import org.antlr.runtime.MismatchedSetException;
import org.antlr.runtime.NoViableAltException;
import org.antlr.runtime.Parser;
import org.antlr.runtime.ParserRuleReturnScope;
import org.antlr.runtime.RecognitionException;
import org.antlr.runtime.RecognizerSharedState;
import org.antlr.runtime.Token;
import org.antlr.runtime.TokenStream;

import util.GenContext;

public class BasicRegexpParser extends Parser {
    public static final String[] tokenNames = new String[]{
            "<invalid>", "<EOR>", "<DOWN>", "<UP>", "Or", "Star", "Plus", "QuestionMark", "CurlyBracketStart", "Decimal", "CurlyBracketEnd", "Comma", "Dot", "ShortCharClass", "Escape", "RoundBracketStart", "RoundBracketEnd", "Colon", "UpperAlpha", "LowerAlpha", "UnderScore", "Digit", "SquareBracketStart", "SquareBracketEnd", "And", "Hyphen", "Equals", "LessThan", "GreaterThan", "ExclamationMark", "OtherChar", "EscapeSequence", "Caret", "Dollar"
    };
    public static final int EOF = -1;
    public static final int Or = 4;
    public static final int Star = 5;
    public static final int Plus = 6;
    public static final int QuestionMark = 7;
    public static final int CurlyBracketStart = 8;
    public static final int Decimal = 9;
    public static final int CurlyBracketEnd = 10;
    public static final int Comma = 11;
    public static final int Dot = 12;
    public static final int ShortCharClass = 13;
    public static final int Escape = 14;
    public static final int RoundBracketStart = 15;
    public static final int RoundBracketEnd = 16;
    public static final int Colon = 17;
    public static final int UpperAlpha = 18;
    public static final int LowerAlpha = 19;
    public static final int UnderScore = 20;
    public static final int Digit = 21;
    public static final int SquareBracketStart = 22;
    public static final int SquareBracketEnd = 23;
    public static final int And = 24;
    public static final int Hyphen = 25;
    public static final int Equals = 26;
    public static final int LessThan = 27;
    public static final int GreaterThan = 28;
    public static final int ExclamationMark = 29;
    public static final int OtherChar = 30;
    public static final int EscapeSequence = 31;
    public static final int Caret = 32;
    public static final int Dollar = 33;

    // delegates
    // delegators


    public BasicRegexpParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }

    public BasicRegexpParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);

    }


    public String[] getTokenNames() {
        return BasicRegexpParser.tokenNames;
    }

    public String getGrammarFileName() {
        return "BasicRegexp.g";
    }


    protected static class parse_scope {
        GenContext int_ctx;
        int idx_cnt;
    }

    protected Stack parse_stack = new Stack();


    // $ANTLR start "parse"
    // BasicRegexp.g:19:1: parse[GenContext ctx] returns [MetaGen meta] : regex EOF ;
    public final MetaGen parse(GenContext ctx) throws RecognitionException {
        parse_stack.push(new parse_scope());
        MetaGen meta = null;

        MetaGen regex1 = null;


        ((parse_scope) parse_stack.peek()).int_ctx = ctx;
        ((parse_scope) parse_stack.peek()).idx_cnt = 1;

        try {
            // BasicRegexp.g:28:2: ( regex EOF )
            // BasicRegexp.g:28:4: regex EOF
            {
                pushFollow(FOLLOW_regex_in_parse45);
                regex1 = regex();

                state._fsp--;

                match(input, EOF, FOLLOW_EOF_in_parse47);
                meta = regex1;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
            parse_stack.pop();
        }
        return meta;
    }
    // $ANTLR end "parse"


    // $ANTLR start "regex"
    // BasicRegexp.g:32:1: regex returns [MetaGen meta] : a1= seqAtoms ( Or a2= seqAtoms )* ;
    public final MetaGen regex() throws RecognitionException {
        MetaGen meta = null;

        MetaGen a1 = null;

        MetaGen a2 = null;


        LinkedList<MetaGen> metas = new LinkedList<MetaGen>();

        try {
            // BasicRegexp.g:36:2: (a1= seqAtoms ( Or a2= seqAtoms )* )
            // BasicRegexp.g:37:2: a1= seqAtoms ( Or a2= seqAtoms )*
            {
                pushFollow(FOLLOW_seqAtoms_in_regex74);
                a1 = seqAtoms();

                state._fsp--;

                metas.add(a1);
                // BasicRegexp.g:37:39: ( Or a2= seqAtoms )*
                loop1:
                do {
                    int alt1 = 2;
                    int LA1_0 = input.LA(1);

                    if ((LA1_0 == Or)) {
                        alt1 = 1;
                    }


                    switch (alt1) {
                        case 1:
                            // BasicRegexp.g:37:40: Or a2= seqAtoms
                        {
                            match(input, Or, FOLLOW_Or_in_regex79);
                            pushFollow(FOLLOW_seqAtoms_in_regex83);
                            a2 = seqAtoms();

                            state._fsp--;

                            metas.add(a2);

                        }
                        break;

                        default:
                            break loop1;
                    }
                } while (true);


                if (metas.size() >= 2) {
                    meta = new Union(metas);
                } else {
                    meta = metas.get(0);
                }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return meta;
    }
    // $ANTLR end "regex"


    // $ANTLR start "seqAtoms"
    // BasicRegexp.g:47:1: seqAtoms returns [MetaGen meta] : (a1= singularRegexAtom ( Star | Plus | QuestionMark | CurlyBracketStart tm1= Decimal CurlyBracketEnd | CurlyBracketStart tm2= Decimal Comma CurlyBracketEnd | CurlyBracketStart tm3= Decimal Comma tn3= Decimal CurlyBracketEnd )? )+ ;
    public final MetaGen seqAtoms() throws RecognitionException {
        MetaGen meta = null;

        Token tm1 = null;
        Token tm2 = null;
        Token tm3 = null;
        Token tn3 = null;
        MetaGen a1 = null;


        LinkedList<MetaGen> metas = new LinkedList<MetaGen>();

        try {
            // BasicRegexp.g:51:2: ( (a1= singularRegexAtom ( Star | Plus | QuestionMark | CurlyBracketStart tm1= Decimal CurlyBracketEnd | CurlyBracketStart tm2= Decimal Comma CurlyBracketEnd | CurlyBracketStart tm3= Decimal Comma tn3= Decimal CurlyBracketEnd )? )+ )
            // BasicRegexp.g:51:4: (a1= singularRegexAtom ( Star | Plus | QuestionMark | CurlyBracketStart tm1= Decimal CurlyBracketEnd | CurlyBracketStart tm2= Decimal Comma CurlyBracketEnd | CurlyBracketStart tm3= Decimal Comma tn3= Decimal CurlyBracketEnd )? )+
            {
                // BasicRegexp.g:51:4: (a1= singularRegexAtom ( Star | Plus | QuestionMark | CurlyBracketStart tm1= Decimal CurlyBracketEnd | CurlyBracketStart tm2= Decimal Comma CurlyBracketEnd | CurlyBracketStart tm3= Decimal Comma tn3= Decimal CurlyBracketEnd )? )+
                int cnt3 = 0;
                loop3:
                do {
                    int alt3 = 2;
                    int LA3_0 = input.LA(1);

                    if ((LA3_0 == Decimal || (LA3_0 >= Comma && LA3_0 <= RoundBracketStart) || (LA3_0 >= Colon && LA3_0 <= UnderScore) || LA3_0 == SquareBracketStart || (LA3_0 >= And && LA3_0 <= EscapeSequence))) {
                        alt3 = 1;
                    }


                    switch (alt3) {
                        case 1:
                            // BasicRegexp.g:51:6: a1= singularRegexAtom ( Star | Plus | QuestionMark | CurlyBracketStart tm1= Decimal CurlyBracketEnd | CurlyBracketStart tm2= Decimal Comma CurlyBracketEnd | CurlyBracketStart tm3= Decimal Comma tn3= Decimal CurlyBracketEnd )?
                        {
                            pushFollow(FOLLOW_singularRegexAtom_in_seqAtoms115);
                            a1 = singularRegexAtom();

                            state._fsp--;

                            metas.add(a1);
                            // BasicRegexp.g:52:4: ( Star | Plus | QuestionMark | CurlyBracketStart tm1= Decimal CurlyBracketEnd | CurlyBracketStart tm2= Decimal Comma CurlyBracketEnd | CurlyBracketStart tm3= Decimal Comma tn3= Decimal CurlyBracketEnd )?
                            int alt2 = 7;
                            alt2 = dfa2.predict(input);
                            switch (alt2) {
                                case 1:
                                    // BasicRegexp.g:52:6: Star
                                {
                                    match(input, Star, FOLLOW_Star_in_seqAtoms124);
                                    metas.add(new Star(metas.removeLast()));

                                }
                                break;
                                case 2:
                                    // BasicRegexp.g:53:6: Plus
                                {
                                    match(input, Plus, FOLLOW_Plus_in_seqAtoms133);
                                    metas.add(new Plus(metas.removeLast()));

                                }
                                break;
                                case 3:
                                    // BasicRegexp.g:54:6: QuestionMark
                                {
                                    match(input, QuestionMark, FOLLOW_QuestionMark_in_seqAtoms142);
                                    metas.add(new Opt(metas.removeLast()));

                                }
                                break;
                                case 4:
                                    // BasicRegexp.g:55:6: CurlyBracketStart tm1= Decimal CurlyBracketEnd
                                {
                                    match(input, CurlyBracketStart, FOLLOW_CurlyBracketStart_in_seqAtoms151);
                                    tm1 = (Token) match(input, Decimal, FOLLOW_Decimal_in_seqAtoms155);
                                    match(input, CurlyBracketEnd, FOLLOW_CurlyBracketEnd_in_seqAtoms157);

                                    int m1 = Integer.parseInt((tm1 != null ? tm1.getText() : null));
                                    metas.add(new NRep(metas.removeLast(), m1, m1));


                                }
                                break;
                                case 5:
                                    // BasicRegexp.g:59:6: CurlyBracketStart tm2= Decimal Comma CurlyBracketEnd
                                {
                                    match(input, CurlyBracketStart, FOLLOW_CurlyBracketStart_in_seqAtoms166);
                                    tm2 = (Token) match(input, Decimal, FOLLOW_Decimal_in_seqAtoms170);
                                    match(input, Comma, FOLLOW_Comma_in_seqAtoms172);
                                    match(input, CurlyBracketEnd, FOLLOW_CurlyBracketEnd_in_seqAtoms174);

                                    int m2 = Integer.parseInt((tm2 != null ? tm2.getText() : null));
                                    metas.add(new NRep(metas.removeLast(), m2, 0));


                                }
                                break;
                                case 6:
                                    // BasicRegexp.g:63:6: CurlyBracketStart tm3= Decimal Comma tn3= Decimal CurlyBracketEnd
                                {
                                    match(input, CurlyBracketStart, FOLLOW_CurlyBracketStart_in_seqAtoms183);
                                    tm3 = (Token) match(input, Decimal, FOLLOW_Decimal_in_seqAtoms187);
                                    match(input, Comma, FOLLOW_Comma_in_seqAtoms189);
                                    tn3 = (Token) match(input, Decimal, FOLLOW_Decimal_in_seqAtoms193);
                                    match(input, CurlyBracketEnd, FOLLOW_CurlyBracketEnd_in_seqAtoms195);

                                    int m3 = Integer.parseInt((tm3 != null ? tm3.getText() : null));
                                    int n3 = Integer.parseInt((tn3 != null ? tn3.getText() : null));
                                    metas.add(new NRep(metas.removeLast(), m3, n3));


                                }
                                break;

                            }


                        }
                        break;

                        default:
                            if (cnt3 >= 1) break loop3;
                            EarlyExitException eee =
                                    new EarlyExitException(3, input);
                            throw eee;
                    }
                    cnt3++;
                } while (true);


                if (metas.size() >= 2) {
                    meta = new Concat(metas);
                } else {
                    meta = metas.get(0);
                }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return meta;
    }
    // $ANTLR end "seqAtoms"


    // $ANTLR start "singularRegexAtom"
    // BasicRegexp.g:79:1: singularRegexAtom returns [MetaGen meta] : ( (a1= characterClass ) | (a2= nonCapturingGroup ) | (a3= generator ) | (a4= group ) | (a5= backReference ) | (a6= literalChars ) | ( Dot ) | (t7= ShortCharClass ) );
    public final MetaGen singularRegexAtom() throws RecognitionException {
        MetaGen meta = null;

        Token t7 = null;
        MetaGen a1 = null;

        MetaGen a2 = null;

        MetaGen a3 = null;

        MetaGen a4 = null;

        MetaGen a5 = null;

        MetaGen a6 = null;


        try {
            // BasicRegexp.g:80:2: ( (a1= characterClass ) | (a2= nonCapturingGroup ) | (a3= generator ) | (a4= group ) | (a5= backReference ) | (a6= literalChars ) | ( Dot ) | (t7= ShortCharClass ) )
            int alt4 = 8;
            alt4 = dfa4.predict(input);
            switch (alt4) {
                case 1:
                    // BasicRegexp.g:80:4: (a1= characterClass )
                {
                    // BasicRegexp.g:80:4: (a1= characterClass )
                    // BasicRegexp.g:80:5: a1= characterClass
                    {
                        pushFollow(FOLLOW_characterClass_in_singularRegexAtom230);
                        a1 = characterClass();

                        state._fsp--;

                        meta = a1;

                    }


                }
                break;
                case 2:
                    // BasicRegexp.g:81:4: (a2= nonCapturingGroup )
                {
                    // BasicRegexp.g:81:4: (a2= nonCapturingGroup )
                    // BasicRegexp.g:81:5: a2= nonCapturingGroup
                    {
                        pushFollow(FOLLOW_nonCapturingGroup_in_singularRegexAtom241);
                        a2 = nonCapturingGroup();

                        state._fsp--;

                        meta = a2;

                    }


                }
                break;
                case 3:
                    // BasicRegexp.g:82:4: (a3= generator )
                {
                    // BasicRegexp.g:82:4: (a3= generator )
                    // BasicRegexp.g:82:5: a3= generator
                    {
                        pushFollow(FOLLOW_generator_in_singularRegexAtom252);
                        a3 = generator();

                        state._fsp--;

                        meta = a3;

                    }


                }
                break;
                case 4:
                    // BasicRegexp.g:83:4: (a4= group )
                {
                    // BasicRegexp.g:83:4: (a4= group )
                    // BasicRegexp.g:83:5: a4= group
                    {
                        pushFollow(FOLLOW_group_in_singularRegexAtom263);
                        a4 = group();

                        state._fsp--;

                        meta = a4;

                    }


                }
                break;
                case 5:
                    // BasicRegexp.g:84:4: (a5= backReference )
                {
                    // BasicRegexp.g:84:4: (a5= backReference )
                    // BasicRegexp.g:84:5: a5= backReference
                    {
                        pushFollow(FOLLOW_backReference_in_singularRegexAtom274);
                        a5 = backReference();

                        state._fsp--;

                        meta = a5;

                    }


                }
                break;
                case 6:
                    // BasicRegexp.g:85:4: (a6= literalChars )
                {
                    // BasicRegexp.g:85:4: (a6= literalChars )
                    // BasicRegexp.g:85:5: a6= literalChars
                    {
                        pushFollow(FOLLOW_literalChars_in_singularRegexAtom285);
                        a6 = literalChars();

                        state._fsp--;

                        meta = a6;

                    }


                }
                break;
                case 7:
                    // BasicRegexp.g:86:4: ( Dot )
                {
                    // BasicRegexp.g:86:4: ( Dot )
                    // BasicRegexp.g:86:5: Dot
                    {
                        match(input, Dot, FOLLOW_Dot_in_singularRegexAtom294);
                        meta = new Dot();

                    }


                }
                break;
                case 8:
                    // BasicRegexp.g:87:4: (t7= ShortCharClass )
                {
                    // BasicRegexp.g:87:4: (t7= ShortCharClass )
                    // BasicRegexp.g:87:5: t7= ShortCharClass
                    {
                        t7 = (Token) match(input, ShortCharClass, FOLLOW_ShortCharClass_in_singularRegexAtom305);
                        meta = new Charset((t7 != null ? t7.getText() : null));

                    }


                }
                break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return meta;
    }
    // $ANTLR end "singularRegexAtom"


    // $ANTLR start "backReference"
    // BasicRegexp.g:91:1: backReference returns [MetaGen meta] : Escape t= Decimal ;
    public final MetaGen backReference() throws RecognitionException {
        MetaGen meta = null;

        Token t = null;

        try {
            // BasicRegexp.g:92:2: ( Escape t= Decimal )
            // BasicRegexp.g:92:4: Escape t= Decimal
            {
                match(input, Escape, FOLLOW_Escape_in_backReference324);
                t = (Token) match(input, Decimal, FOLLOW_Decimal_in_backReference328);
                meta = new Ref(((parse_scope) parse_stack.peek()).int_ctx, Integer.parseInt((t != null ? t.getText() : null)));

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return meta;
    }
    // $ANTLR end "backReference"


    // $ANTLR start "group"
    // BasicRegexp.g:97:1: group returns [MetaGen meta] : RoundBracketStart r= regex RoundBracketEnd ;
    public final MetaGen group() throws RecognitionException {
        MetaGen meta = null;

        MetaGen r = null;


        try {
            // BasicRegexp.g:98:2: ( RoundBracketStart r= regex RoundBracketEnd )
            // BasicRegexp.g:98:4: RoundBracketStart r= regex RoundBracketEnd
            {
                match(input, RoundBracketStart, FOLLOW_RoundBracketStart_in_group347);
                pushFollow(FOLLOW_regex_in_group351);
                r = regex();

                state._fsp--;

                match(input, RoundBracketEnd, FOLLOW_RoundBracketEnd_in_group353);

                meta = new Capture(((parse_scope) parse_stack.peek()).int_ctx, ((parse_scope) parse_stack.peek()).idx_cnt, r);
                ((parse_scope) parse_stack.peek()).idx_cnt++;


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return meta;
    }
    // $ANTLR end "group"


    // $ANTLR start "nonCapturingGroup"
    // BasicRegexp.g:106:1: nonCapturingGroup returns [MetaGen meta] : RoundBracketStart QuestionMark Colon r= regex RoundBracketEnd ;
    public final MetaGen nonCapturingGroup() throws RecognitionException {
        MetaGen meta = null;

        MetaGen r = null;


        try {
            // BasicRegexp.g:107:2: ( RoundBracketStart QuestionMark Colon r= regex RoundBracketEnd )
            // BasicRegexp.g:107:4: RoundBracketStart QuestionMark Colon r= regex RoundBracketEnd
            {
                match(input, RoundBracketStart, FOLLOW_RoundBracketStart_in_nonCapturingGroup372);
                match(input, QuestionMark, FOLLOW_QuestionMark_in_nonCapturingGroup374);
                match(input, Colon, FOLLOW_Colon_in_nonCapturingGroup376);
                pushFollow(FOLLOW_regex_in_nonCapturingGroup380);
                r = regex();

                state._fsp--;

                match(input, RoundBracketEnd, FOLLOW_RoundBracketEnd_in_nonCapturingGroup382);
                meta = r;

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return meta;
    }
    // $ANTLR end "nonCapturingGroup"


    // $ANTLR start "generator"
    // BasicRegexp.g:112:1: generator returns [MetaGen meta] : RoundBracketStart QuestionMark CurlyBracketStart (method= genName ) ( RoundBracketStart (arg= genArg ) ( Comma (arg= genArg ) )* RoundBracketEnd )? CurlyBracketEnd RoundBracketEnd ;
    public final MetaGen generator() throws RecognitionException {
        MetaGen meta = null;

        BasicRegexpParser.genName_return method = null;

        BasicRegexpParser.genArg_return arg = null;


        String name = null;
        List<String> args = new LinkedList<String>();

        try {
            // BasicRegexp.g:117:2: ( RoundBracketStart QuestionMark CurlyBracketStart (method= genName ) ( RoundBracketStart (arg= genArg ) ( Comma (arg= genArg ) )* RoundBracketEnd )? CurlyBracketEnd RoundBracketEnd )
            // BasicRegexp.g:117:4: RoundBracketStart QuestionMark CurlyBracketStart (method= genName ) ( RoundBracketStart (arg= genArg ) ( Comma (arg= genArg ) )* RoundBracketEnd )? CurlyBracketEnd RoundBracketEnd
            {
                match(input, RoundBracketStart, FOLLOW_RoundBracketStart_in_generator407);
                match(input, QuestionMark, FOLLOW_QuestionMark_in_generator409);
                match(input, CurlyBracketStart, FOLLOW_CurlyBracketStart_in_generator411);
                // BasicRegexp.g:118:3: (method= genName )
                // BasicRegexp.g:118:4: method= genName
                {
                    pushFollow(FOLLOW_genName_in_generator418);
                    method = genName();

                    state._fsp--;

                    name = (method != null ? input.toString(method.start, method.stop) : null);

                }

                // BasicRegexp.g:119:3: ( RoundBracketStart (arg= genArg ) ( Comma (arg= genArg ) )* RoundBracketEnd )?
                int alt6 = 2;
                int LA6_0 = input.LA(1);

                if ((LA6_0 == RoundBracketStart)) {
                    alt6 = 1;
                }
                switch (alt6) {
                    case 1:
                        // BasicRegexp.g:120:4: RoundBracketStart (arg= genArg ) ( Comma (arg= genArg ) )* RoundBracketEnd
                    {
                        match(input, RoundBracketStart, FOLLOW_RoundBracketStart_in_generator430);
                        // BasicRegexp.g:121:4: (arg= genArg )
                        // BasicRegexp.g:121:5: arg= genArg
                        {
                            pushFollow(FOLLOW_genArg_in_generator438);
                            arg = genArg();

                            state._fsp--;

                            args.add((arg != null ? input.toString(arg.start, arg.stop) : null));

                        }

                        // BasicRegexp.g:122:4: ( Comma (arg= genArg ) )*
                        loop5:
                        do {
                            int alt5 = 2;
                            int LA5_0 = input.LA(1);

                            if ((LA5_0 == Comma)) {
                                alt5 = 1;
                            }


                            switch (alt5) {
                                case 1:
                                    // BasicRegexp.g:122:5: Comma (arg= genArg )
                                {
                                    match(input, Comma, FOLLOW_Comma_in_generator447);
                                    // BasicRegexp.g:122:11: (arg= genArg )
                                    // BasicRegexp.g:122:12: arg= genArg
                                    {
                                        pushFollow(FOLLOW_genArg_in_generator452);
                                        arg = genArg();

                                        state._fsp--;

                                        args.add((arg != null ? input.toString(arg.start, arg.stop) : null));

                                    }


                                }
                                break;

                                default:
                                    break loop5;
                            }
                        } while (true);

                        match(input, RoundBracketEnd, FOLLOW_RoundBracketEnd_in_generator462);

                    }
                    break;

                }

                match(input, CurlyBracketEnd, FOLLOW_CurlyBracketEnd_in_generator471);
                match(input, RoundBracketEnd, FOLLOW_RoundBracketEnd_in_generator473);
                meta = new Eval(((parse_scope) parse_stack.peek()).int_ctx, name, args);

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return meta;
    }
    // $ANTLR end "generator"

    public static class genName_return extends ParserRuleReturnScope {
    }

    ;

    // $ANTLR start "genName"
    // BasicRegexp.g:129:1: genName : ( UpperAlpha | LowerAlpha | UnderScore ) ( UpperAlpha | LowerAlpha | UnderScore | Digit )* ;
    public final BasicRegexpParser.genName_return genName() throws RecognitionException {
        BasicRegexpParser.genName_return retval = new BasicRegexpParser.genName_return();
        retval.start = input.LT(1);

        try {
            // BasicRegexp.g:129:9: ( ( UpperAlpha | LowerAlpha | UnderScore ) ( UpperAlpha | LowerAlpha | UnderScore | Digit )* )
            // BasicRegexp.g:129:11: ( UpperAlpha | LowerAlpha | UnderScore ) ( UpperAlpha | LowerAlpha | UnderScore | Digit )*
            {
                if ((input.LA(1) >= UpperAlpha && input.LA(1) <= UnderScore)) {
                    input.consume();
                    state.errorRecovery = false;
                } else {
                    MismatchedSetException mse = new MismatchedSetException(null, input);
                    throw mse;
                }

                // BasicRegexp.g:129:50: ( UpperAlpha | LowerAlpha | UnderScore | Digit )*
                loop7:
                do {
                    int alt7 = 2;
                    int LA7_0 = input.LA(1);

                    if (((LA7_0 >= UpperAlpha && LA7_0 <= Digit))) {
                        alt7 = 1;
                    }


                    switch (alt7) {
                        case 1:
                            // BasicRegexp.g:
                        {
                            if ((input.LA(1) >= UpperAlpha && input.LA(1) <= Digit)) {
                                input.consume();
                                state.errorRecovery = false;
                            } else {
                                MismatchedSetException mse = new MismatchedSetException(null, input);
                                throw mse;
                            }


                        }
                        break;

                        default:
                            break loop7;
                    }
                } while (true);


            }

            retval.stop = input.LT(-1);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "genName"

    public static class genArg_return extends ParserRuleReturnScope {
    }

    ;

    // $ANTLR start "genArg"
    // BasicRegexp.g:132:1: genArg : (~ ( Comma | RoundBracketEnd ) )+ ;
    public final BasicRegexpParser.genArg_return genArg() throws RecognitionException {
        BasicRegexpParser.genArg_return retval = new BasicRegexpParser.genArg_return();
        retval.start = input.LT(1);

        try {
            // BasicRegexp.g:132:8: ( (~ ( Comma | RoundBracketEnd ) )+ )
            // BasicRegexp.g:132:10: (~ ( Comma | RoundBracketEnd ) )+
            {
                // BasicRegexp.g:132:10: (~ ( Comma | RoundBracketEnd ) )+
                int cnt8 = 0;
                loop8:
                do {
                    int alt8 = 2;
                    int LA8_0 = input.LA(1);

                    if (((LA8_0 >= Or && LA8_0 <= CurlyBracketEnd) || (LA8_0 >= Dot && LA8_0 <= RoundBracketStart) || (LA8_0 >= Colon && LA8_0 <= Dollar))) {
                        alt8 = 1;
                    }


                    switch (alt8) {
                        case 1:
                            // BasicRegexp.g:132:10: ~ ( Comma | RoundBracketEnd )
                        {
                            if ((input.LA(1) >= Or && input.LA(1) <= CurlyBracketEnd) || (input.LA(1) >= Dot && input.LA(1) <= RoundBracketStart) || (input.LA(1) >= Colon && input.LA(1) <= Dollar)) {
                                input.consume();
                                state.errorRecovery = false;
                            } else {
                                MismatchedSetException mse = new MismatchedSetException(null, input);
                                throw mse;
                            }


                        }
                        break;

                        default:
                            if (cnt8 >= 1) break loop8;
                            EarlyExitException eee =
                                    new EarlyExitException(8, input);
                            throw eee;
                    }
                    cnt8++;
                } while (true);


            }

            retval.stop = input.LT(-1);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "genArg"


    // $ANTLR start "characterClass"
    // BasicRegexp.g:136:1: characterClass returns [MetaGen meta] : SquareBracketStart t= characterClassContent SquareBracketEnd ;
    public final MetaGen characterClass() throws RecognitionException {
        MetaGen meta = null;

        BasicRegexpParser.characterClassContent_return t = null;


        try {
            // BasicRegexp.g:137:2: ( SquareBracketStart t= characterClassContent SquareBracketEnd )
            // BasicRegexp.g:137:4: SquareBracketStart t= characterClassContent SquareBracketEnd
            {
                match(input, SquareBracketStart, FOLLOW_SquareBracketStart_in_characterClass547);
                pushFollow(FOLLOW_characterClassContent_in_characterClass551);
                t = characterClassContent();

                state._fsp--;

                match(input, SquareBracketEnd, FOLLOW_SquareBracketEnd_in_characterClass553);
                meta = new Charset((t != null ? input.toString(t.start, t.stop) : null));

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return meta;
    }
    // $ANTLR end "characterClass"


    // $ANTLR start "literalChars"
    // BasicRegexp.g:141:1: literalChars returns [MetaGen meta] : ( ( (t= And | t= Hyphen | t= Colon | t= Equals | t= LessThan | t= GreaterThan | t= ExclamationMark | t= Comma | t= Decimal | t= UpperAlpha | t= LowerAlpha | t= UnderScore | t= OtherChar ) ) | (t= EscapeSequence ) );
    public final MetaGen literalChars() throws RecognitionException {
        MetaGen meta = null;

        Token t = null;

        try {
            // BasicRegexp.g:142:2: ( ( (t= And | t= Hyphen | t= Colon | t= Equals | t= LessThan | t= GreaterThan | t= ExclamationMark | t= Comma | t= Decimal | t= UpperAlpha | t= LowerAlpha | t= UnderScore | t= OtherChar ) ) | (t= EscapeSequence ) )
            int alt10 = 2;
            int LA10_0 = input.LA(1);

            if ((LA10_0 == Decimal || LA10_0 == Comma || (LA10_0 >= Colon && LA10_0 <= UnderScore) || (LA10_0 >= And && LA10_0 <= OtherChar))) {
                alt10 = 1;
            } else if ((LA10_0 == EscapeSequence)) {
                alt10 = 2;
            } else {
                NoViableAltException nvae =
                        new NoViableAltException("", 10, 0, input);

                throw nvae;
            }
            switch (alt10) {
                case 1:
                    // BasicRegexp.g:143:2: ( (t= And | t= Hyphen | t= Colon | t= Equals | t= LessThan | t= GreaterThan | t= ExclamationMark | t= Comma | t= Decimal | t= UpperAlpha | t= LowerAlpha | t= UnderScore | t= OtherChar ) )
                {
                    // BasicRegexp.g:143:2: ( (t= And | t= Hyphen | t= Colon | t= Equals | t= LessThan | t= GreaterThan | t= ExclamationMark | t= Comma | t= Decimal | t= UpperAlpha | t= LowerAlpha | t= UnderScore | t= OtherChar ) )
                    // BasicRegexp.g:144:3: (t= And | t= Hyphen | t= Colon | t= Equals | t= LessThan | t= GreaterThan | t= ExclamationMark | t= Comma | t= Decimal | t= UpperAlpha | t= LowerAlpha | t= UnderScore | t= OtherChar )
                    {
                        // BasicRegexp.g:144:3: (t= And | t= Hyphen | t= Colon | t= Equals | t= LessThan | t= GreaterThan | t= ExclamationMark | t= Comma | t= Decimal | t= UpperAlpha | t= LowerAlpha | t= UnderScore | t= OtherChar )
                        int alt9 = 13;
                        switch (input.LA(1)) {
                            case And: {
                                alt9 = 1;
                            }
                            break;
                            case Hyphen: {
                                alt9 = 2;
                            }
                            break;
                            case Colon: {
                                alt9 = 3;
                            }
                            break;
                            case Equals: {
                                alt9 = 4;
                            }
                            break;
                            case LessThan: {
                                alt9 = 5;
                            }
                            break;
                            case GreaterThan: {
                                alt9 = 6;
                            }
                            break;
                            case ExclamationMark: {
                                alt9 = 7;
                            }
                            break;
                            case Comma: {
                                alt9 = 8;
                            }
                            break;
                            case Decimal: {
                                alt9 = 9;
                            }
                            break;
                            case UpperAlpha: {
                                alt9 = 10;
                            }
                            break;
                            case LowerAlpha: {
                                alt9 = 11;
                            }
                            break;
                            case UnderScore: {
                                alt9 = 12;
                            }
                            break;
                            case OtherChar: {
                                alt9 = 13;
                            }
                            break;
                            default:
                                NoViableAltException nvae =
                                        new NoViableAltException("", 9, 0, input);

                                throw nvae;
                        }

                        switch (alt9) {
                            case 1:
                                // BasicRegexp.g:144:5: t= And
                            {
                                t = (Token) match(input, And, FOLLOW_And_in_literalChars580);

                            }
                            break;
                            case 2:
                                // BasicRegexp.g:145:5: t= Hyphen
                            {
                                t = (Token) match(input, Hyphen, FOLLOW_Hyphen_in_literalChars588);

                            }
                            break;
                            case 3:
                                // BasicRegexp.g:146:5: t= Colon
                            {
                                t = (Token) match(input, Colon, FOLLOW_Colon_in_literalChars596);

                            }
                            break;
                            case 4:
                                // BasicRegexp.g:147:5: t= Equals
                            {
                                t = (Token) match(input, Equals, FOLLOW_Equals_in_literalChars604);

                            }
                            break;
                            case 5:
                                // BasicRegexp.g:148:5: t= LessThan
                            {
                                t = (Token) match(input, LessThan, FOLLOW_LessThan_in_literalChars612);

                            }
                            break;
                            case 6:
                                // BasicRegexp.g:149:5: t= GreaterThan
                            {
                                t = (Token) match(input, GreaterThan, FOLLOW_GreaterThan_in_literalChars620);

                            }
                            break;
                            case 7:
                                // BasicRegexp.g:150:5: t= ExclamationMark
                            {
                                t = (Token) match(input, ExclamationMark, FOLLOW_ExclamationMark_in_literalChars628);

                            }
                            break;
                            case 8:
                                // BasicRegexp.g:151:5: t= Comma
                            {
                                t = (Token) match(input, Comma, FOLLOW_Comma_in_literalChars636);

                            }
                            break;
                            case 9:
                                // BasicRegexp.g:152:5: t= Decimal
                            {
                                t = (Token) match(input, Decimal, FOLLOW_Decimal_in_literalChars644);

                            }
                            break;
                            case 10:
                                // BasicRegexp.g:153:5: t= UpperAlpha
                            {
                                t = (Token) match(input, UpperAlpha, FOLLOW_UpperAlpha_in_literalChars652);

                            }
                            break;
                            case 11:
                                // BasicRegexp.g:154:5: t= LowerAlpha
                            {
                                t = (Token) match(input, LowerAlpha, FOLLOW_LowerAlpha_in_literalChars660);

                            }
                            break;
                            case 12:
                                // BasicRegexp.g:155:5: t= UnderScore
                            {
                                t = (Token) match(input, UnderScore, FOLLOW_UnderScore_in_literalChars668);

                            }
                            break;
                            case 13:
                                // BasicRegexp.g:156:5: t= OtherChar
                            {
                                t = (Token) match(input, OtherChar, FOLLOW_OtherChar_in_literalChars676);

                            }
                            break;

                        }

                        meta = new Literal((t != null ? t.getText() : null));

                    }


                }
                break;
                case 2:
                    // BasicRegexp.g:161:2: (t= EscapeSequence )
                {
                    // BasicRegexp.g:161:2: (t= EscapeSequence )
                    // BasicRegexp.g:161:4: t= EscapeSequence
                    {
                        t = (Token) match(input, EscapeSequence, FOLLOW_EscapeSequence_in_literalChars697);
                        meta = new Literal((t != null ? t.getText() : null).substring(1));

                    }


                }
                break;

            }
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return meta;
    }
    // $ANTLR end "literalChars"

    public static class characterClassContent_return extends ParserRuleReturnScope {
    }

    ;

    // $ANTLR start "characterClassContent"
    // BasicRegexp.g:166:1: characterClassContent : ( Caret )? ( ShortCharClass | rangeAtom ( Hyphen rangeAtom )? )+ ;
    public final BasicRegexpParser.characterClassContent_return characterClassContent() throws RecognitionException {
        BasicRegexpParser.characterClassContent_return retval = new BasicRegexpParser.characterClassContent_return();
        retval.start = input.LT(1);

        try {
            // BasicRegexp.g:167:2: ( ( Caret )? ( ShortCharClass | rangeAtom ( Hyphen rangeAtom )? )+ )
            // BasicRegexp.g:167:4: ( Caret )? ( ShortCharClass | rangeAtom ( Hyphen rangeAtom )? )+
            {
                // BasicRegexp.g:167:4: ( Caret )?
                int alt11 = 2;
                int LA11_0 = input.LA(1);

                if ((LA11_0 == Caret)) {
                    alt11 = 1;
                }
                switch (alt11) {
                    case 1:
                        // BasicRegexp.g:167:4: Caret
                    {
                        match(input, Caret, FOLLOW_Caret_in_characterClassContent715);

                    }
                    break;

                }

                // BasicRegexp.g:168:2: ( ShortCharClass | rangeAtom ( Hyphen rangeAtom )? )+
                int cnt13 = 0;
                loop13:
                do {
                    int alt13 = 3;
                    int LA13_0 = input.LA(1);

                    if ((LA13_0 == ShortCharClass)) {
                        alt13 = 1;
                    } else if (((LA13_0 >= Or && LA13_0 <= Dot) || (LA13_0 >= RoundBracketStart && LA13_0 <= UnderScore) || LA13_0 == And || (LA13_0 >= Equals && LA13_0 <= OtherChar) || LA13_0 == Dollar)) {
                        alt13 = 2;
                    }


                    switch (alt13) {
                        case 1:
                            // BasicRegexp.g:168:4: ShortCharClass
                        {
                            match(input, ShortCharClass, FOLLOW_ShortCharClass_in_characterClassContent721);

                        }
                        break;
                        case 2:
                            // BasicRegexp.g:169:4: rangeAtom ( Hyphen rangeAtom )?
                        {
                            pushFollow(FOLLOW_rangeAtom_in_characterClassContent726);
                            rangeAtom();

                            state._fsp--;

                            // BasicRegexp.g:169:14: ( Hyphen rangeAtom )?
                            int alt12 = 2;
                            int LA12_0 = input.LA(1);

                            if ((LA12_0 == Hyphen)) {
                                alt12 = 1;
                            }
                            switch (alt12) {
                                case 1:
                                    // BasicRegexp.g:169:15: Hyphen rangeAtom
                                {
                                    match(input, Hyphen, FOLLOW_Hyphen_in_characterClassContent729);
                                    pushFollow(FOLLOW_rangeAtom_in_characterClassContent731);
                                    rangeAtom();

                                    state._fsp--;


                                }
                                break;

                            }


                        }
                        break;

                        default:
                            if (cnt13 >= 1) break loop13;
                            EarlyExitException eee =
                                    new EarlyExitException(13, input);
                            throw eee;
                    }
                    cnt13++;
                } while (true);


            }

            retval.stop = input.LT(-1);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return retval;
    }
    // $ANTLR end "characterClassContent"


    // $ANTLR start "rangeAtom"
    // BasicRegexp.g:173:1: rangeAtom : ( And | Or | Colon | Dollar | RoundBracketStart | RoundBracketEnd | CurlyBracketStart | CurlyBracketEnd | Equals | LessThan | GreaterThan | ExclamationMark | Comma | Plus | Star | QuestionMark | Dot | Decimal | UpperAlpha | LowerAlpha | UnderScore | OtherChar );
    public final void rangeAtom() throws RecognitionException {
        try {
            // BasicRegexp.g:174:2: ( And | Or | Colon | Dollar | RoundBracketStart | RoundBracketEnd | CurlyBracketStart | CurlyBracketEnd | Equals | LessThan | GreaterThan | ExclamationMark | Comma | Plus | Star | QuestionMark | Dot | Decimal | UpperAlpha | LowerAlpha | UnderScore | OtherChar )
            // BasicRegexp.g:
            {
                if ((input.LA(1) >= Or && input.LA(1) <= Dot) || (input.LA(1) >= RoundBracketStart && input.LA(1) <= UnderScore) || input.LA(1) == And || (input.LA(1) >= Equals && input.LA(1) <= OtherChar) || input.LA(1) == Dollar) {
                    input.consume();
                    state.errorRecovery = false;
                } else {
                    MismatchedSetException mse = new MismatchedSetException(null, input);
                    throw mse;
                }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input, re);
        }
        finally {
        }
        return;
    }
    // $ANTLR end "rangeAtom"

    // Delegated rules


    protected DFA2 dfa2 = new DFA2(this);
    protected DFA4 dfa4 = new DFA4(this);
    static final String DFA2_eotS =
            "\13\uffff";
    static final String DFA2_eofS =
            "\1\5\12\uffff";
    static final String DFA2_minS =
            "\1\4\3\uffff\1\11\1\uffff\1\12\1\uffff\1\11\2\uffff";
    static final String DFA2_maxS =
            "\1\37\3\uffff\1\11\1\uffff\1\13\1\uffff\1\12\2\uffff";
    static final String DFA2_acceptS =
            "\1\uffff\1\1\1\2\1\3\1\uffff\1\7\1\uffff\1\4\1\uffff\1\5\1\6";
    static final String DFA2_specialS =
            "\13\uffff}>";
    static final String[] DFA2_transitionS = {
            "\1\5\1\1\1\2\1\3\1\4\1\5\1\uffff\12\5\1\uffff\1\5\1\uffff\10" +
                    "\5",
            "",
            "",
            "",
            "\1\6",
            "",
            "\1\7\1\10",
            "",
            "\1\12\1\11",
            "",
            ""
    };

    static final short[] DFA2_eot = DFA.unpackEncodedString(DFA2_eotS);
    static final short[] DFA2_eof = DFA.unpackEncodedString(DFA2_eofS);
    static final char[] DFA2_min = DFA.unpackEncodedStringToUnsignedChars(DFA2_minS);
    static final char[] DFA2_max = DFA.unpackEncodedStringToUnsignedChars(DFA2_maxS);
    static final short[] DFA2_accept = DFA.unpackEncodedString(DFA2_acceptS);
    static final short[] DFA2_special = DFA.unpackEncodedString(DFA2_specialS);
    static final short[][] DFA2_transition;

    static {
        int numStates = DFA2_transitionS.length;
        DFA2_transition = new short[numStates][];
        for (int i = 0; i < numStates; i++) {
            DFA2_transition[i] = DFA.unpackEncodedString(DFA2_transitionS[i]);
        }
    }

    class DFA2 extends DFA {

        public DFA2(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 2;
            this.eot = DFA2_eot;
            this.eof = DFA2_eof;
            this.min = DFA2_min;
            this.max = DFA2_max;
            this.accept = DFA2_accept;
            this.special = DFA2_special;
            this.transition = DFA2_transition;
        }

        public String getDescription() {
            return "52:4: ( Star | Plus | QuestionMark | CurlyBracketStart tm1= Decimal CurlyBracketEnd | CurlyBracketStart tm2= Decimal Comma CurlyBracketEnd | CurlyBracketStart tm3= Decimal Comma tn3= Decimal CurlyBracketEnd )?";
        }
    }

    static final String DFA4_eotS =
            "\13\uffff";
    static final String DFA4_eofS =
            "\13\uffff";
    static final String DFA4_minS =
            "\1\11\1\uffff\1\7\4\uffff\1\10\3\uffff";
    static final String DFA4_maxS =
            "\1\37\1\uffff\1\37\4\uffff\1\21\3\uffff";
    static final String DFA4_acceptS =
            "\1\uffff\1\1\1\uffff\1\5\1\6\1\7\1\10\1\uffff\1\4\1\2\1\3";
    static final String DFA4_specialS =
            "\13\uffff}>";
    static final String[] DFA4_transitionS = {
            "\1\4\1\uffff\1\4\1\5\1\6\1\3\1\2\1\uffff\4\4\1\uffff\1\1\1\uffff" +
                    "\10\4",
            "",
            "\1\7\1\uffff\1\10\1\uffff\5\10\1\uffff\4\10\1\uffff\1\10\1" +
                    "\uffff\10\10",
            "",
            "",
            "",
            "",
            "\1\12\10\uffff\1\11",
            "",
            "",
            ""
    };

    static final short[] DFA4_eot = DFA.unpackEncodedString(DFA4_eotS);
    static final short[] DFA4_eof = DFA.unpackEncodedString(DFA4_eofS);
    static final char[] DFA4_min = DFA.unpackEncodedStringToUnsignedChars(DFA4_minS);
    static final char[] DFA4_max = DFA.unpackEncodedStringToUnsignedChars(DFA4_maxS);
    static final short[] DFA4_accept = DFA.unpackEncodedString(DFA4_acceptS);
    static final short[] DFA4_special = DFA.unpackEncodedString(DFA4_specialS);
    static final short[][] DFA4_transition;

    static {
        int numStates = DFA4_transitionS.length;
        DFA4_transition = new short[numStates][];
        for (int i = 0; i < numStates; i++) {
            DFA4_transition[i] = DFA.unpackEncodedString(DFA4_transitionS[i]);
        }
    }

    class DFA4 extends DFA {

        public DFA4(BaseRecognizer recognizer) {
            this.recognizer = recognizer;
            this.decisionNumber = 4;
            this.eot = DFA4_eot;
            this.eof = DFA4_eof;
            this.min = DFA4_min;
            this.max = DFA4_max;
            this.accept = DFA4_accept;
            this.special = DFA4_special;
            this.transition = DFA4_transition;
        }

        public String getDescription() {
            return "79:1: singularRegexAtom returns [MetaGen meta] : ( (a1= characterClass ) | (a2= nonCapturingGroup ) | (a3= generator ) | (a4= group ) | (a5= backReference ) | (a6= literalChars ) | ( Dot ) | (t7= ShortCharClass ) );";
        }
    }


    public static final BitSet FOLLOW_regex_in_parse45 = new BitSet(new long[]{ 0x0000000000000000L });
    public static final BitSet FOLLOW_EOF_in_parse47 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_seqAtoms_in_regex74 = new BitSet(new long[]{ 0x0000000000000012L });
    public static final BitSet FOLLOW_Or_in_regex79 = new BitSet(new long[]{ 0x00000000FF5EFA00L });
    public static final BitSet FOLLOW_seqAtoms_in_regex83 = new BitSet(new long[]{ 0x0000000000000012L });
    public static final BitSet FOLLOW_singularRegexAtom_in_seqAtoms115 = new BitSet(new long[]{ 0x00000000FF5EFBE2L });
    public static final BitSet FOLLOW_Star_in_seqAtoms124 = new BitSet(new long[]{ 0x00000000FF5EFA02L });
    public static final BitSet FOLLOW_Plus_in_seqAtoms133 = new BitSet(new long[]{ 0x00000000FF5EFA02L });
    public static final BitSet FOLLOW_QuestionMark_in_seqAtoms142 = new BitSet(new long[]{ 0x00000000FF5EFA02L });
    public static final BitSet FOLLOW_CurlyBracketStart_in_seqAtoms151 = new BitSet(new long[]{ 0x0000000000000200L });
    public static final BitSet FOLLOW_Decimal_in_seqAtoms155 = new BitSet(new long[]{ 0x0000000000000400L });
    public static final BitSet FOLLOW_CurlyBracketEnd_in_seqAtoms157 = new BitSet(new long[]{ 0x00000000FF5EFA02L });
    public static final BitSet FOLLOW_CurlyBracketStart_in_seqAtoms166 = new BitSet(new long[]{ 0x0000000000000200L });
    public static final BitSet FOLLOW_Decimal_in_seqAtoms170 = new BitSet(new long[]{ 0x0000000000000800L });
    public static final BitSet FOLLOW_Comma_in_seqAtoms172 = new BitSet(new long[]{ 0x0000000000000400L });
    public static final BitSet FOLLOW_CurlyBracketEnd_in_seqAtoms174 = new BitSet(new long[]{ 0x00000000FF5EFA02L });
    public static final BitSet FOLLOW_CurlyBracketStart_in_seqAtoms183 = new BitSet(new long[]{ 0x0000000000000200L });
    public static final BitSet FOLLOW_Decimal_in_seqAtoms187 = new BitSet(new long[]{ 0x0000000000000800L });
    public static final BitSet FOLLOW_Comma_in_seqAtoms189 = new BitSet(new long[]{ 0x0000000000000200L });
    public static final BitSet FOLLOW_Decimal_in_seqAtoms193 = new BitSet(new long[]{ 0x0000000000000400L });
    public static final BitSet FOLLOW_CurlyBracketEnd_in_seqAtoms195 = new BitSet(new long[]{ 0x00000000FF5EFA02L });
    public static final BitSet FOLLOW_characterClass_in_singularRegexAtom230 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_nonCapturingGroup_in_singularRegexAtom241 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_generator_in_singularRegexAtom252 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_group_in_singularRegexAtom263 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_backReference_in_singularRegexAtom274 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_literalChars_in_singularRegexAtom285 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_Dot_in_singularRegexAtom294 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_ShortCharClass_in_singularRegexAtom305 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_Escape_in_backReference324 = new BitSet(new long[]{ 0x0000000000000200L });
    public static final BitSet FOLLOW_Decimal_in_backReference328 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_RoundBracketStart_in_group347 = new BitSet(new long[]{ 0x00000000FF5EFA00L });
    public static final BitSet FOLLOW_regex_in_group351 = new BitSet(new long[]{ 0x0000000000010000L });
    public static final BitSet FOLLOW_RoundBracketEnd_in_group353 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_RoundBracketStart_in_nonCapturingGroup372 = new BitSet(new long[]{ 0x0000000000000080L });
    public static final BitSet FOLLOW_QuestionMark_in_nonCapturingGroup374 = new BitSet(new long[]{ 0x0000000000020000L });
    public static final BitSet FOLLOW_Colon_in_nonCapturingGroup376 = new BitSet(new long[]{ 0x00000000FF5EFA00L });
    public static final BitSet FOLLOW_regex_in_nonCapturingGroup380 = new BitSet(new long[]{ 0x0000000000010000L });
    public static final BitSet FOLLOW_RoundBracketEnd_in_nonCapturingGroup382 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_RoundBracketStart_in_generator407 = new BitSet(new long[]{ 0x0000000000000080L });
    public static final BitSet FOLLOW_QuestionMark_in_generator409 = new BitSet(new long[]{ 0x0000000000000100L });
    public static final BitSet FOLLOW_CurlyBracketStart_in_generator411 = new BitSet(new long[]{ 0x00000000001C0000L });
    public static final BitSet FOLLOW_genName_in_generator418 = new BitSet(new long[]{ 0x0000000000008400L });
    public static final BitSet FOLLOW_RoundBracketStart_in_generator430 = new BitSet(new long[]{ 0x00000003FFFEF7F0L });
    public static final BitSet FOLLOW_genArg_in_generator438 = new BitSet(new long[]{ 0x0000000000010800L });
    public static final BitSet FOLLOW_Comma_in_generator447 = new BitSet(new long[]{ 0x00000003FFFEF7F0L });
    public static final BitSet FOLLOW_genArg_in_generator452 = new BitSet(new long[]{ 0x0000000000010800L });
    public static final BitSet FOLLOW_RoundBracketEnd_in_generator462 = new BitSet(new long[]{ 0x0000000000000400L });
    public static final BitSet FOLLOW_CurlyBracketEnd_in_generator471 = new BitSet(new long[]{ 0x0000000000010000L });
    public static final BitSet FOLLOW_RoundBracketEnd_in_generator473 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_set_in_genName486 = new BitSet(new long[]{ 0x00000000003C0002L });
    public static final BitSet FOLLOW_set_in_genName498 = new BitSet(new long[]{ 0x00000000003C0002L });
    public static final BitSet FOLLOW_set_in_genArg523 = new BitSet(new long[]{ 0x00000003FFFEF7F2L });
    public static final BitSet FOLLOW_SquareBracketStart_in_characterClass547 = new BitSet(new long[]{ 0x000000037D1FBFF0L });
    public static final BitSet FOLLOW_characterClassContent_in_characterClass551 = new BitSet(new long[]{ 0x0000000000800000L });
    public static final BitSet FOLLOW_SquareBracketEnd_in_characterClass553 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_And_in_literalChars580 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_Hyphen_in_literalChars588 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_Colon_in_literalChars596 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_Equals_in_literalChars604 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_LessThan_in_literalChars612 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_GreaterThan_in_literalChars620 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_ExclamationMark_in_literalChars628 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_Comma_in_literalChars636 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_Decimal_in_literalChars644 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_UpperAlpha_in_literalChars652 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_LowerAlpha_in_literalChars660 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_UnderScore_in_literalChars668 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_OtherChar_in_literalChars676 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_EscapeSequence_in_literalChars697 = new BitSet(new long[]{ 0x0000000000000002L });
    public static final BitSet FOLLOW_Caret_in_characterClassContent715 = new BitSet(new long[]{ 0x000000037D1FBFF0L });
    public static final BitSet FOLLOW_ShortCharClass_in_characterClassContent721 = new BitSet(new long[]{ 0x000000037D1FBFF2L });
    public static final BitSet FOLLOW_rangeAtom_in_characterClassContent726 = new BitSet(new long[]{ 0x000000037F1FBFF2L });
    public static final BitSet FOLLOW_Hyphen_in_characterClassContent729 = new BitSet(new long[]{ 0x000000037D1FBFF0L });
    public static final BitSet FOLLOW_rangeAtom_in_characterClassContent731 = new BitSet(new long[]{ 0x000000037D1FBFF2L });
    public static final BitSet FOLLOW_set_in_rangeAtom0 = new BitSet(new long[]{ 0x0000000000000002L });

}